package com.example.pingtools.bean;

import com.example.mygreendao.DaoSession;
import com.example.mygreendao.FloderBeanDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Keep;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;
import com.example.mygreendao.IpDataBeanDao;

@Entity
public class FloderBean{

    @Id(autoincrement = true)
    private Long id;
    private String name;
    @ToMany(referencedJoinProperty = "customId")
    private List<IpDataBean> ipDataBeans;
    /** Used for active entity operations. */
    @Generated(hash = 1863633410)
    private transient FloderBeanDao myDao;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    @Keep
    public FloderBean( String name) {
        this.name = name;
    }
    @Keep
    public FloderBean() {
    }
    @Generated(hash = 1927968530)
    public FloderBean(Long id, String name) {
        this.id = id;
        this.name = name;
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }


    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 879496181)
    public List<IpDataBean> getIpDataBeans() {
        if (ipDataBeans == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            IpDataBeanDao targetDao = daoSession.getIpDataBeanDao();
            List<IpDataBean> ipDataBeansNew = targetDao._queryFloderBean_IpDataBeans(id);
            synchronized (this) {
                if (ipDataBeans == null) {
                    ipDataBeans = ipDataBeansNew;
                }
            }
        }
        return ipDataBeans;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 527000374)
    public synchronized void resetIpDataBeans() {
        ipDataBeans = null;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 680374972)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getFloderBeanDao() : null;
    }



}
